import { VNode } from "vue";
//TODO 对已经加载过的图片进行缓存，不去重新请求
let cache: { idx: number; component: VNode }[] = [];
export function useCache(idx: number, component?: VNode) {
  if (!component) {
    return cache[idx];
  }
  cache.push({ idx, component });
  return [];
}
